import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class Solution824 {
    public String toGoatLatin(String sentence) {
        String[] strings=sentence.split(" ");
        Set<Character> set=new HashSet<>(Arrays.asList('a','e','i','o','u','A','E','I','O','U'));
        for (int i=0;i<strings.length;i++){
            StringBuilder stringBuilder=new StringBuilder(strings[i]);
            if (!set.contains(stringBuilder.charAt(0))) {
                stringBuilder.append(stringBuilder.charAt(0));
                stringBuilder.deleteCharAt(0);
            }
            stringBuilder.append("ma");
            for (int j=0;j<i+1;j++){
                stringBuilder.append('a');
            }
            strings[i]=stringBuilder.toString();
        }
        StringBuilder stringBuilder=new StringBuilder(strings[0]);
        for (int i=1;i<strings.length;i++){
            stringBuilder.append(' ').append(strings[i]);
        }
        return stringBuilder.toString();
    }

    public static void main(String[] args) {
        System.out.println(new Solution824().toGoatLatin("I speak Goat Latin"));
    }
}
